<?php 

include '../function.php';

// $str = "345*93485A";

// $prep = "/\{\}/";

// var_dump(preg_match($prep, $str));





// $str = "学并思官网www.xuebingsiwang.com学并思论坛  http://bbs.xuebingsiwang.com我在学并思的网名叫xuebingsi";
// $preg = "/(xuebingsi)wang/";
// $newStr= preg_replace($preg,'<span  style="color:#f00">\1</span>wang',$str);
// echo $newStr;


// $str = "23700000000000000423940";

// $preg = "/0$/";

// var_dump(preg_match($preg, $str));


// 验证用户名

// $str = 'a9sAd8fd';


// $preg = "/^[A-Za-z][A-Za-z0-9_]{5,7}$/";


// var_dump(preg_match($preg, $str));


// $str = "13125139194";


// $preg = "/^(131|132|133)[0-9]{8}$/";

// var_dump(preg_match($preg, $str));b

// $str = "sdfsdfdfserddwewertwe";
// $preg ="/dd/";

// var_dump(preg_match_all($preg, $str, $ouput));

// var_dump($ouput);




$str = "a@sina.com.cn.cn.ty";


$preg = "/^[a-z0-9][a-z0-9_]*@[a-z0-9][a-z0-9-]*[a-z0-9](\.[a-z]{2,})+$/i";

// $preg = "/^[a-z0-9][a-z0-9_]*@[a-z0-9][a-z0-9-]*[a-z0-9]\.[a-z]{2}$/i";

 var_dump(preg_match($preg, $str));


















 ?>